import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home'
import Friends from '../views/Friends'
import Cart from '../views/Cart'
import Search from '../views/Search'
import NewsList from '../views/Home/news/NewsList'
import NewsInfo from '../views/Home/news/NewsInfo'
import PhotoList from '../views/Home/photo/PhotoList'
import PhotoInfo from '../views/Home/photo/PhotoInfo'

Vue.use(VueRouter)

const routes = [{
    path: '/home',
    component: Home
  },
  {
    path: '/friends',
    component: Friends
  },
  {
    path: '/cart',
    component: Cart
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/home/newslist',
    component: NewsList
  },
  {
    path: '/home/newsinfo/:id',
    component: NewsInfo
  },
  {
    path: '/home/photolist',
    component: PhotoList
  },
  {
    path: '/home/photoinfo/:id',
    component: PhotoInfo
  }
  // {
  //   path: '/',
  //   name: 'home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
